package edu.kit.aifb.ldstream.learner.dao;

import java.io.Serializable;

import org.openrdf.model.impl.URIImpl;

import edu.kit.aifb.ldstream.stat.distrib.IDistribution;

public class Property extends URIImpl implements Serializable{

	private static final long serialVersionUID = -4398752360325584906L;

	private boolean bnode; 
	private boolean interDomain;
	
	private IDistribution distrib;
	
	public Property(String uri, boolean bnode, boolean itd){
		super(uri);
		this.bnode = bnode;
		this.interDomain = itd;
	}

	/**
	 * @return the true if the linked object is a bnode
	 */
	public boolean isBnode() {
		return bnode;
	}
	
	/**
	 * 
	 * @return true if the object origins from a different domain.
	 */
	public boolean isInterDomain(){
		return this.interDomain;
	}
	
	public IDistribution getDistribution(){
		
		if(this.distrib == null){
			throw new NullPointerException("Distribtuion for property " + this.stringValue() + " is not set.");
		}
		return this.distrib;
	}

	public void setDistribution(IDistribution distrib){
		this.distrib = distrib;
	}
	
}
